import React from 'react';
import { Form, Row, DatePicker, Button, Select, Input, Col, Radio, Card, Icon, Modal } from 'antd';
const FormItem = Form.Item;
const { Option } = Select;
const { RangePicker } = DatePicker

const DetailsForm = ({ form: { getFieldDecorator, getFieldsValue }, formData, titleStyle, title, isEdit }) => {

    return (
        <div>
            <Card
                title={<div style={titleStyle}>{title}</div>}
                bordered={false}>
                <Form layout='vertical'>
                    <Row gutter={16}>
                        <Col span={6}>
                            <FormItem label="机型">
                                {getFieldDecorator('model', {
                                    initialValue: formData.model
                                })(
                                    <Input placeholder='请输入机型' allowClear disabled />
                                )}
                            </FormItem>
                        </Col>
                        <Col span={6}>
                            <FormItem label="批号">
                                {getFieldDecorator('batchNo', {
                                    initialValue: formData.batchNo
                                })(
                                    <Input placeholder='请输入批号' allowClear disabled />
                                )}
                            </FormItem>
                        </Col>
                        <Col span={6}>
                            <FormItem label="编码">
                                {getFieldDecorator('formCoding', {
                                    initialValue: formData.formCoding,
                                })(
                                    <Input placeholder='请输入表格编码' disabled />
                                )}
                            </FormItem>
                        </Col>
                        <Col span={6}>
                            <FormItem label="类型">
                                {getFieldDecorator('isInPlant', {
                                    initialValue: formData.isInPlant
                                })(
                                    <Radio.Group disabled={!isEdit}>
                                        <Radio value={0}>厂外</Radio>
                                        <Radio value={1}>厂内</Radio>
                                    </Radio.Group>
                                )}
                            </FormItem>
                        </Col>
                    </Row>
                </Form>
            </Card>

        </div>
    );
};

export default Form.create()(DetailsForm);
